package honeypot.action;

import java.util.Map;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class AuthInterceptor extends AbstractInterceptor {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3353585800611151455L;

	public String intercept(ActionInvocation invocation) throws Exception {
		Map map=invocation.getInvocationContext().getSession();
		if(map.get("user")==null)
		{
			return Action.LOGIN;
		}
		else
		{
			return invocation.invoke();
		}
	}

}
